<template>
  <el-form
    ref="ruleFormRef"
    :model="ruleForm"
    :rules="rules"
    size="large">
    <el-form-item prop="name">
      <el-input v-model="ruleForm.name" placeholder="请输入姓名" />
    </el-form-item>
    <el-form-item prop="phone">
      <el-input
        v-model.trim="ruleForm.phone"
        placeholder="请输入手机号码"
        maxlength="11"
        @keyup.enter="" />
    </el-form-item>
    <el-form-item prop="password">
      <el-input
        v-model.trim="ruleForm.password"
        placeholder="请输入登录密码"
        maxlength="20"
        minlength="8"
        show-password
        @keyup.enter="" />
    </el-form-item>
    <el-form-item prop="rePassword">
      <el-input
        v-model.trim="ruleForm.rePassword"
        placeholder="请确认登录密码"
        maxlength="20"
        minlength="8"
        show-password
        @keyup.enter="" />
    </el-form-item>
  </el-form>
  <div class="login-text">已有账号？<Text to="logo">登录</Text></div>
  <Button>提交注册</Button>
</template>

<script setup>
// 切换组件文本
import Text from '../text.vue'
// 提交按钮
import Button from '../button.vue'

const ruleForm = reactive({
  // 用户名
  name: '',
  // 手机号
  phone: '',
  // 密码
  password: '',
  // 确认密码
  rePassword: '',
})
const rules = reactive({
   // phone: [{ required: true, validator: validateMobile, trigger: 'blur' }],
})
</script>

<style lang="scss" scoped>
.login-text{
  color: #666;
  font-size: 14px;
  line-height: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
</style>
